import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/login";
import Register from "@/views/register";
import Layout from "@/views/layout";

import Information from "@/views/information";
import Article from "@/views/article";
import Looking from "@/views/looking";
import User from "@/views/user";

Vue.use(VueRouter);

const routes = [
  { path: "/login", component: Login },
  { path: "/register", component: Register },
  {
    path: "/",
    component: Layout,
    redirect: "/article",
    children: [
      { path: "/article", component: Article },
      { path: "/information", component: Information },
      { path: "/looking", component: Looking },
      { path: "/user", component: User },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
